package com.iqiu.cms.service;

import com.ibeetl.admin.core.service.BaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.iqiu.cms.dao.CoreTestdataDao;
import com.iqiu.cms.entity.CoreTestdata;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 检测数据 Service
 */

@Service
@Transactional
public class CoreTestdataService extends BaseService<CoreTestdata>{

    @Autowired private CoreTestdataDao coreTestdataDao;

    public PageQuery<CoreTestdata> queryByCondition(PageQuery query){
        PageQuery ret =  coreTestdataDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }
    public PageQuery<CoreTestdata> queryByCondition1(PageQuery query){
            PageQuery ret =  coreTestdataDao.queryByCondition1(query);
            queryListAfter(ret.getList());
            return ret;
    }

    public void batchDelCoreTestdata(List<Long> ids){
        try {
            coreTestdataDao.batchDelCoreTestdataByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除检测数据失败", e);
        }
    }

    public Map selectCount(Map m){
        return  coreTestdataDao.selectCount(m);
    }
    public CoreTestdata detail(Long id){
        return  coreTestdataDao.detail(id);
    }

}